package com.itheima.utils;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author tongchen
 * @create 2022-12-18 11:53
 */
@RestControllerAdvice
public class ResultException {
    @ExceptionHandler
    public Result doException(Exception ex){
        //记录日志
        //通知运维
        //通知开发
        ex.printStackTrace();//写出异常
        return new Result("服务器异常");
    }
}
